#!/usr/bin/python
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks


model_id = 'bart/nlp_bart_text-error-correction_chinese'
input = '遇到逆竟时，我们必须勇于面对，而且要愈挫愈勇，这样我们才能朝著成功之路前进。'
pipeline = pipeline(Tasks.text_error_correction, model=model_id,device="cpu")
x = input
result = pipeline(x)
print(result)

